<template>
	<view class="">
		<view class="topbox">
			<view class="statebox" v-if="obj.state==3">
				<image src="http://youjialibo.wm76.mtnet.ren/upload/20210907/0ebcf7a78e81d520503e24a4b3c90ae1.png" mode=""></image>
				<text>交易已完成</text>
			</view>
			<view class="statebox" v-if="obj.state==1">
				<image src="http://youjialibo.wm76.mtnet.ren/upload/20210907/f3847cd8b3f5c4bbb83d4d98526d463f.png" mode=""></image>
				<text>待发货</text>
			</view>
			<view class="statebox" v-if="obj.state==2">
				<image src="http://youjialibo.wm76.mtnet.ren/upload/20210907/30db46fd3f96b147f68bb60ad02680df.png" mode=""></image>
				<text>待收货</text>
			</view>
			<view class="dzbox">

				<view class="leftbox">
					<view class="namebox">
						<text class="name">{{obj.name}}</text>
						<text>{{obj.phone}}</text>
					</view>
					<view class="site">
						{{obj.address}}
					</view>
				</view>
			</view>
		</view>
		<view class="boxs">
			<view class="title">
				商品信息
			</view>
			<view class="spxx" @click="jfproductxq">
				<image :src="obj.commodity.img" mode=""></image>
				<view class="rightbox">
					<view class="namebox">
						<view class="name">
							{{obj.commodity.name}}
						</view>
						<view class="shulian">
							×{{obj.num}}
						</view>
					</view>
					<view class="jifenbox">
						<text class="num">{{obj.commodity.integral}}</text>
						<text>积分</text>
					</view>
				</view>
			</view>
			<view class="hr"></view>
			<view class="title">
				商品名称
			</view>
			<view class="spbox">
				<text class="leftbox">商品合计：</text>
				<text class="rightbox">{{obj.integral}}积分</text>
			</view>
			<!-- <view class="spbox">
				<text class="leftbox">运费：</text>
				<text class="rightbox">￥0.00</text>
			</view> -->
			<view class="hr"></view>
			<view class="spboxs">
				<view class="ordernum">
					<text class="leftbox">订单编号：</text>
					<text class="rightbox">{{obj.order_num}}</text>
				</view>
				<view class="fzhi" @click="cope(obj.order_num)">
					复制
				</view>
			</view>
			<view class="spbox">
				<text class="leftbox">提交时间：</text>
				<text class="rightbox">{{obj.create_time}}</text>
			</view>
			<view class="spbox">
				<text class="leftbox">支付积分：</text>
				<text class="rightbox">{{obj.integral}}积分</text>
			</view>
			<view class="spbox">
				<text class="leftbox">兑换时间：</text>
				<text class="rightbox">{{obj.update_time}}</text>
			</view>
			<view class="smallbox">

			</view>
		</view>
	</view>
</template>

<script>
	import {getintegralorderinfo} from "../../api/api/index.js"
	export default {
		data() {
			return {
				id:0,
				obj:{}
			}
		},
		methods: {
			cope(v) {
				let a=v.toString()
				uni.setClipboardData({
				    data: a,
				    success: function () {
				    },
					fail() {
						console.log("失败")
					}
				});
			},
			jfproductxq(){
				// console.log(this.obj)
				this.jumpLink({
					link: "/pagesB/jfproductxq/index",
					query: {
						id: this.obj.commodity.id
					}
				})
			}
		},
		onShow() {
			let data={id:this.id}
			uni.showLoading({
				title:"加载中"
			})
			getintegralorderinfo(data).then(res=>{
				uni.hideLoading()
				this.obj=res.data
			})
		},
		onLoad(v){
			this.id=v.id
		}
	}
</script>

<style scoped lang="scss">
	.topbox {
		background-color: #f42121;
		height: 315rpx;
		padding-top: 50rpx;
		box-sizing: border-box;

		.statebox {
			margin-left: 40rpx;
			align-items: center;
			display: flex;

			image {
				width: 90rpx;
				height: 90rpx;
			}

			text {
				font-family: MicrosoftYaHei-Bold;
				font-size: 36rpx;
				color: #ffffff;
				font-weight: 700;
				margin-left: 35rpx;
			}
		}

		.dzbox {
			background-color: #FFFFFF;
			width: 700rpx;
			border-top-left-radius: 6rpx;
			border-top-right-radius: 6rpx;
			height: 166rpx;
			margin-left: 25rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 45rpx 38rpx 36rpx 29rpx;
			box-sizing: border-box;
			margin-top: 13rpx;

			.namebox {
				text {
					font-family: MicrosoftYaHei;
					font-size: 24rpx;
					color: #282828;
				}

				.name {
					font-family: MicrosoftYaHei-Bold;
					font-size: 28rpx;
					color: #333333;
					font-weight: 700;
					margin-right: 20rpx;
				}
			}

			.site {
				font-family: MicrosoftYaHei;
				font-size: 24rpx;
				color: #282828;
				margin-top: 30rpx;
			}
		}

		.angle {
			width: 20rpx;
			height: 20rpx;
			border-top: 1px solid #000;
			border-left: 1px solid #000;
			transform: rotate(135deg)
		}
	}

	.boxs {
		background-color: #FFFFFF;
		margin-top: 15rpx;
		margin-left: 25rpx;
		padding-left: 10rpx;
		padding-right: 10rpx;
		padding-top: 32rpx;
		box-sizing: border-box;
		width: 700rpx;
		border-bottom-left-radius: 6rpx;
		border-bottom-right-radius: 6rpx;

		.title {
			font-family: MicrosoftYaHei-Bold;
			font-size: 28rpx;
			color: #333333;
			font-weight: 700;
			margin-left: 19rpx;
		}

		.hr {
			width: 678rpx;
			height: 1rpx;
			background-color: #000000;
			opacity: 0.2;
			margin-top: 30rpx;
			margin-bottom: 40rpx;
		}

		.spxx {
			margin-left: 19rpx;
			display: flex;
			margin-top: 30rpx;

			image {
				width: 181rpx;
				height: 181rpx;
			}

			.rightbox {
				margin-left: 18rpx;

				.namebox {
					display: flex;
					justify-content: space-between;

					.name {
						width: 397rpx;
						margin-right: 30rpx;
						line-height: 36rpx;
						font-family: MicrosoftYaHei;
						font-size: 24rpx;
						color: #000000;
					}

					.shulian {
						font-family: MicrosoftYaHei;
						font-size: 24rpx;
						color: #000000;
					}
				}

				.jifenbox {
					font-family: MicrosoftYaHei;
					font-size: 20rpx;
					color: #666666;
					margin-top: 35rpx;

					.num {
						font-family: PingFang-SC-Medium;
						font-size: 30rpx;
						color: #ff3333;
						margin-right: 20rpx;
					}
				}
			}
		}

		.spbox {
			margin-left: 17rpx;
			margin-top: 30rpx;

			.leftbox {
				color: #999999;
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
			}

			.rightbox {
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
				color: #000000;
			}
		}

		.spboxs {
			display: flex;
			justify-content: space-between;
			margin-left: 17rpx;
			align-items: center;

			.leftbox {
				color: #999999;
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
			}

			.rightbox {
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
				color: #000000;
			}

			.fzhi {
				width: 101rpx;
				height: 45rpx;
				background-color: #efefef;
				border-radius: 23rpx;
				border: solid 2rpx #949494;
				font-family: MicrosoftYaHei;
				font-size: 22rpx;
				color: #282828;
				line-height: 45rpx;
				text-align: center;
			}
		}

		.smallbox {
			height: 100rpx;
		}
	}
</style>
